﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KPIS.GERP.GHRMS.MODEL
{
    [TableName("hrm_ps_emp_salary_histories")]
    public class HisSalaryInfo : TableInfo
    {
        [Field("sal_his_seq", typeof(int), true)]
        public int sal_his_seq { get; set; }

        [Field("emp_seq", typeof(int))]
        public int emp_seq { get; set; }

        [Field("start_date", typeof(DateTime?))]
        public DateTime? start_date { get; set; }

        [Field("end_date", typeof(DateTime?))]
        public DateTime? end_date { get; set; }

        [Field("cmd_ref_no", typeof(string))]
        public string cmd_ref_no { get; set; }

        [Field("cmd_name", typeof(string))]
        public string cmd_name { get; set; }

        [Field("cmd_date", typeof(int))]
        public DateTime? cmd_date { get; set; }

        [Field("pos_ref", typeof(string))]
        public string pos_ref { get; set; }

        [Field("pos_name", typeof(string))]
        public string pos_name { get; set; }

        [Field("class_seq", typeof(int))]
        public int class_seq { get; set; }

        [Field("class_name", typeof(string))]
        public string class_name { get; set; }

        [Field("job_site_seq", typeof(int))]
        public int job_site_seq { get; set; }

        [Field("job_site_name", typeof(string))]
        public string job_site_name { get; set; }

        [Field("salary_new", typeof(double))]
        public double salary_new { get; set; }

        [Field("salary_old", typeof(double))]
        public double salary_old { get; set; }

        [Field("salary_percent_up", typeof(double))]
		public double salary_percent_up
		{
			get
			{
				try
				{
					if (salary_old == 0)
						return 0;

					double a = (salary_up / salary_old);
					double b = a * 100;
					return b > 99.99 ? 99.99 : 0;
				}
				catch
				{
					return -1;
				}
			}
		}

        [Field("salary_up", typeof(double))]
		public double salary_up
		{
			get
			{
				try
				{
					return salary_new - salary_old;
				}
				catch
				{
					return -1;
				}
			}
		}

        [Field("salary_midpoint", typeof(double))]
        public double salary_midpoint { get; set; }

        [Field("salary_extra", typeof(double))]
        public double salary_extra { get; set; }

        [Field("salary_extra_seq", typeof(int))]
        public int salary_extra_seq { get; set; }

        [Field("total_score", typeof(double))]
        public double total_score { get; set; }

        [Field("move_seq", typeof(int))]
        public int move_seq { get; set; }

        [Field("move_name", typeof(string))]
        public string move_name { get; set; }

        [Field("remarks", typeof(string))]
        public string remarks { get; set; }

        [Field("record_status", typeof(string), false, true)]
        public string record_status { get; set; }

        [Field("created_by", typeof(int), false, false, true)]
        public int created_by { get; set; }

        [Field("created_when", typeof(DateTime), false, false, false, true)]
        public DateTime created_when { get; set; }

        [Field("updated_by", typeof(int), false, false, false, false, true)]
        public int updated_by { get; set; }

        [Field("updated_when", typeof(DateTime), false, false, false, false, false, true)]
		public DateTime updated_when { get; set; }
	}
}
